package sctu.edu.java.year2016.team07.wenjia.practice.nine;

/**
 * Created by 001 on 2016/5/29.
 * 匿名内部类去除空格
 */
public class OutString {
    public static void main(String[]args){
        final String sourceStr="今 天 吃 了 吗 ？";
        IStringDeal s=new IStringDeal(){
            @Override
        public String filterBlankChar(){
                String convertStr=sourceStr;
                convertStr=convertStr.replaceAll(" ","");
                return convertStr;
            }
        };
        System.out.println("源字符串:"+sourceStr);
        System.out.println("去除空格后的字符串:"+s.filterBlankChar());

    }
}
